package streamproc;

import java.util.Vector;

import streamdef.EventSet;
import event.Event;

public abstract class ChainComponent {
	protected ChainComponent next = null;
	protected ChainComponent prev = null;

	public abstract void reset();

	protected void finalize() {
		try {
			super.finalize();
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}

	public abstract void init();

	public void setNext(ChainComponent cc) {
		this.next = cc;
		cc.prev = this;
	}

	public synchronized void processEvent(Event e) {
		System.out.println("processEvent :: Empty function !");
	}

	public synchronized void processEvents(Vector<Event> events) {
		System.out.println("processEvents :: Empty function !");
	}

	public synchronized void processQueryResults(Vector<EventSet> v) {
		System.out.println("processQueryResults :: Empty function !");
		v.clear();
	}

	// for cleanerComp
	public synchronized void processByteArray(long streamID, byte[] data) {
		System.out.println("processByteArray :: Empty function !");
	}

	// for cleanerComp
	public synchronized void processByteArrayWithTimestamp(long streamID,
			byte[] data, java.sql.Timestamp timestamp) {
		System.out.println("processByteArrayWithTimestamp :: Empty function !");
	}
}
